import sys
sys.path.insert(0, "/home/lighthouse/my-dream")
import yaml
from module.dir import CONFIG_YML_DIR


def get_config(params: list):
    
    try:
        content = ""
        global par
        with open(CONFIG_YML_DIR, 'r', encoding='utf-8') as f:
            file_content = f.read()
            content = yaml.load(file_content, yaml.FullLoader)
            config_con = content['dev']
        for par in params:
            config_con = config_con.get(par)
            if config_con is None:
                return 1
        return config_con
    except AttributeError as a:
        print('列表' + str(par) + '数值出现错误，程序异常退出'+str(a))
